﻿@using ZDSoft.LMS.Domain;
@model Role
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
    var FunctionList = ViewBag.FunctionList as IList<SystemFunctionDto>;
}
<link href="@Url.Content("~/Content/Style/ViewPage.css")" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
    function SubmitForm() {
        $("form").eq(0).submit();
    }
</script>
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%; background-color: White;"
    align="center">
    <tr>
        <td class="mbg">
            <table cellspacing="0" cellpadding="0" width="100%" border="0" valign="top">
                <tr>
                    <td>
                        <table style="height: 23px;" cellspacing="0" cellpadding="0" width="120" background="@Url.Content("~/Content/Images/m_17.gif")"
                            border="0">
                            <tr>
                                <td>
                                    <span class="contentPageTitle">&nbsp;&gt;&gt; 配置权限</span>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td align="right" class="titleContentDivider" height="6">
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>
<p>
    @Html.ActionLink("返回列表", "Index")
</p>
<fieldset>
    <div class="editor-label">
        @Html.LabelFor(model => model.RoleName)：
        @Html.DisplayFor(model => model.RoleName)
    </div>
</fieldset>
<p>
    @using (Html.BeginForm("Index", "Authorize"))
    {
        <input type="hidden" name="roleID" value="@ViewBag.RoleID" />
        <span>筛选：</span>@Html.DropDownList("topFunctionID", new SelectList(ViewBag.TopFunctions, "ID", "SystemFunctionName"), "------全部-----", new { onchange = "SubmitForm()" })
    }
</p>
<table cellpadding="0" cellspacing="0" class="dataGrid">
    <tr>
        <th>
            操作权限
            <input type="checkbox" title="全选/取消全选" />
        </th>
        <th>
            功能名称
        </th>
    </tr>
    @if (FunctionList == null || FunctionList.Count() == 0)
    { 
        <tr>
            <td colspan="12">
                没有满足条件的记录!
            </td>
        </tr>
    }
    else
    {
        foreach (var item in FunctionList)
        {
        <tr>
            <td>
                @Html.CheckBoxFor(itemItem => item.IsChecked)
            </td>
            <td>
                @item.Name
            </td>
        </tr>
        }
    }
</table>

<p>
    <input type="button" class="btn3" value="保存" />
</p>